<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    class Person {
      name = 'person'
      constructor(play, swim) {
        this.play = play
        this.swim = swim
      }
      static run() {
        console.log('Person can running')
      }
      eat() {
        console.log('i can eat')
      }
      sleep() {
        console.log('i can sleep')
      }
      get jump() {
        //获取属性值
        //用于动态jisuan
        return 'tiaoyitiao'
      }
      set behavior(val) {
        //对属性进行修改
        this.play = val
        console.log('there are behavior')
      }
    }
    class Women extends Person {
      constructor(play, swim, huazhuan, jianfei) {
        super(play, swim)
        this.huazhuan = huazhuan
        this.jianfei = jianfei
      }
      daban() {
        console.log('i can daban')
      }
    }
    let person1 = new Person('basketball', 'wayong')
    console.log(person1.sleep)
    //console.log(person1.eat)
    console.log(person1.jump)
    console.log(person1.eat)
    console.log(Person.run)
    person1.behavior = 'This is my behavior'
    console.log(person1.behavior)
    console.log(person1)
    let stu = new Women('yumaoqiu', 'dieyong', 'oumei', 'shou')
    console.log(stu)
  </script>
</head>

<body>

</body>

</html>